package tinynio;

import java.nio.ByteBuffer;

public class StringCodec implements Codec {

	@Override
	public String decode(ByteBuffer param) {
		return new String(param.array());
	}

	@Override
	public ByteBuffer encode(Object param) {
		return ByteBuffer.wrap(((String) param).getBytes());
	}

}
